< previous page page_152 next page >

Page 152
Listing 5.39. continued
Dim m_CheckSize As Boolean
Dim m_MinLength As Integer
Dim m_MaxLength As Integer
' Default values
Const m_def_CheckSize = 0
Const m_def_MinLength = 0
Const m_def_MaxLength = 0

' ------------------------------------------------
' Required values
'
Public Event RequiredError() ' event
Dim m_Required As Boolean ' property
Const m_def_Required = 0 ' default

' ------------------------------------------------
' Conditional values
Public Event ConditionalError(strMsg) ' event
Dim m_CheckConditional As Boolean ' property
Const m_def_CheckConditional = 0 ' default
Next comes the InitProperties event. Listing 5.40 shows the entire InitProperties event, including the Required and Conditional values.
Type.gifListing 5.40. The final UserControl_InitProperties event code.
Private Sub UserControl_InitProperties()
    '
    ' initialize control values
    '
    With UserControl
        .Width = 1200
        .Height = 300
    End With
    '
    Text1.Text = UserControl.Name
    '
    ' KeyFilter properties
    m_UpperCase = m_def_UpperCase
    m_Digits = m_def_Digits
    m_Numeric = m_def_Numeric
    '
    ' InRange properties
    m_CheckRange = m_def_CheckRange
    m_HighValue = m_def_HighValue
    m_LowValue = m_def_LowValue
    '
    ' CheckSize properties
    m_CheckSize = m_def_CheckSize

 
< previous page page_152 next page >

If you like this book, buy it!